﻿<controls:MetroWindow xmlns:Toolkit="clr-namespace:Xceed.Wpf.Toolkit;assembly=Xceed.Wpf.Toolkit"  x:Class="GroepEF4.Algemeen"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
        Title="Samen Sterker - Gebruiker" Height="658.5" Width="1089"
        Icon="Img\SamenSterker.ico" Topmost="True" ShowIconOnTitleBar="False"
        GlowBrush="{DynamicResource AccentColorBrush}"
        WindowStartupLocation="CenterScreen"
        EnableDWMDropShadow="True"
        ResizeMode="CanResizeWithGrip" Loaded="MetroWindow_Loaded">

    <Window.Resources>
        <Style TargetType="{x:Type Image}">
            <Setter Property="RenderOptions.BitmapScalingMode" 
               Value="HighQuality" />
        </Style>

        <Style x:Key="btnStyle1" TargetType="{x:Type Button}">
            <Setter Property="Background" Value="#27ae60"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Border Background="{TemplateBinding Background}">
                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="#2ecc71"/>
                </Trigger>
            </Style.Triggers>
        </Style>
    </Window.Resources>

    <controls:MetroWindow.Flyouts>
        <controls:FlyoutsControl>
            <controls:Flyout x:Name="ReservationFlyout"
                             Width="500"
                             Header="Reservatie toevoegen"
                             Position="Right"
                             Theme="Dark"
                             IsPinned="False">
                <Grid Margin="10">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <ScrollViewer Grid.Row="1"
                                  VerticalScrollBarVisibility="Auto">
                        <StackPanel Orientation="Vertical">
                            <Label Content="Bedrijf:" FontSize="12" HorizontalAlignment="Left" VerticalAlignment="Top" Foreground="White" Margin="0,20,0,0"/>
                            <ComboBox Name="cboCompany" DisplayMemberPath="Name" />
                            <Label Content="Locatie:" FontSize="12" HorizontalAlignment="Left" VerticalAlignment="Top" Foreground="White" Margin="0,30,0,0"/>
                            <ComboBox Name="cboLocatie" DisplayMemberPath="Name"/>
                            <Label Content="Begin:" FontSize="12" HorizontalAlignment="Left" VerticalAlignment="Top" Foreground="White" Margin="0,30,0,0"/>
                            <Toolkit:DateTimePicker Name="DateBegin" Foreground="White"/>
                            <Label Content="Einde:" FontSize="12" HorizontalAlignment="Left" VerticalAlignment="Top" Foreground="White" Margin="0,30,0,0"/>
                            <Toolkit:DateTimePicker Name="DateEnd" Foreground="White"/>
                        </StackPanel>
                    </ScrollViewer>
                    <UniformGrid Columns="2"
                                 Grid.Row="2"
                                 Margin="10">
                        <Button Style="{DynamicResource SquareButtonStyle}"
                                Margin="10"
                                Content="Toevoegen" 
                                Background="#1d1d1d"
                                Foreground="White"
                                Click="AddReservation"/>
                        <Button Style="{DynamicResource SquareButtonStyle}"
                                Margin="10"
                                Content="Annuleren" 
                                Background="#1d1d1d"
                                Foreground="White"
                                Click="CancelReservation"/>
                    </UniformGrid>
                </Grid>
            </controls:Flyout>

            <controls:Flyout x:Name="ReservationEditFlyout"
                             Width="500"
                             Header="Reservatie Wijzigen"
                             Position="Right"
                             Theme="Dark"
                             IsPinned="False">
                <Grid Margin="10">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <ScrollViewer Grid.Row="1"
                                  VerticalScrollBarVisibility="Auto">
                        <StackPanel Orientation="Vertical">
                            <Label Content="Bedrijf:" FontSize="12" HorizontalAlignment="Left" VerticalAlignment="Top" Foreground="White" Margin="0,20,0,0"/>
                            <ComboBox Name="cboCompany2" DisplayMemberPath="Name"  SelectedValue = "{Binding CompanyId}" SelectedValuePath="Id"/>
                            <Label Content="Locatie:" FontSize="12" HorizontalAlignment="Left" VerticalAlignment="Top" Foreground="White" Margin="0,30,0,0"/>
                            <ComboBox Name="cboLocatie2" DisplayMemberPath="Name"  SelectedValue = "{Binding LocatieId}" SelectedValuePath="Id"/>
                            <Label Content="Begin:" FontSize="12" HorizontalAlignment="Left" VerticalAlignment="Top" Foreground="White" Margin="0,30,0,0"/>
                            <Toolkit:DateTimePicker Name="DateBegin2" Foreground="White"/>
                            <Label Content="Einde:" FontSize="12" HorizontalAlignment="Left" VerticalAlignment="Top" Foreground="White" Margin="0,30,0,0"/>
                            <Toolkit:DateTimePicker Name="DateEnd2" Foreground="White"/>
                        </StackPanel>
                    </ScrollViewer>
                    <UniformGrid Columns="2"
                                 Grid.Row="2"
                                 Margin="10">
                        <Button Style="{DynamicResource SquareButtonStyle}"
                                Margin="10"
                                Content="Wijzig" 
                                Background="#1d1d1d"
                                Foreground="White"
                                Click="EditReservation"/>
                        <Button Style="{DynamicResource SquareButtonStyle}"
                                Margin="10"
                                Content="Annuleren" 
                                Background="#1d1d1d"
                                Foreground="White"
                                Click="CancelEdit"/>
                    </UniformGrid>
                </Grid>
            </controls:Flyout>
        </controls:FlyoutsControl>
    </controls:MetroWindow.Flyouts>




    <Grid Margin="0,0,0,42">
        <Button x:Name="LogOutButton" Click="LogOutButton_Click" HorizontalAlignment="Right" Margin="0,10,10,0"  VerticalAlignment="Top" Width="60" Style="{DynamicResource MetroCircleButtonStyle}" Height="60">
            <Rectangle Fill="#7f8c8d" Height="29" RenderTransformOrigin="0.5,0.5" Width="27" >
                <Rectangle.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform ScaleY="-1" ScaleX="-1"/>
                        <SkewTransform/>
                        <RotateTransform Angle="-180.033"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </Rectangle.RenderTransform>
                <Rectangle.OpacityMask>
                    <VisualBrush Visual="{StaticResource appbar_door_leave}" Stretch="Fill" />
                </Rectangle.OpacityMask>
            </Rectangle>
        </Button>
        <Image Source="Img\SamenSterker.png" Margin="20,10,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="90" Height="90" RenderOptions.EdgeMode="Aliased"/>
        <TabControl>
            <TabItem Header="Mijn contracten" Margin="125,34,-124,-35">
                <Grid Margin="0,-21,0,21">
                    <DataGrid x:Name="ContractLopendeGrid" AutoGenerateColumns="False" HorizontalAlignment="Left" Margin="107,123,0,0" VerticalAlignment="Top" Height="180" Width="709" IsReadOnly="True">
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=CompanyName}" Header="Bedrijf"/>
                            <DataGridTextColumn Binding="{Binding Path=Description}" Header="Contract Formula"/>
                            <DataGridTextColumn Binding="{Binding Path=StartDate}" Header="Startdatum"/>
                            <DataGridTextColumn Binding="{Binding Path=EndDate}" Header="Einddatum"/>
                        </DataGrid.Columns>
                    </DataGrid>

                    <Button x:Name="StopContract" Margin="0,107,10,0" Style="{DynamicResource MetroCircleButtonStyle}" Width="60" Height="60" VerticalAlignment="Top" HorizontalAlignment="Right" Click="StopContract_Click">
                        <Rectangle Fill="#7f8c8d" Height="26" RenderTransformOrigin="0.5,0.5" Width="27">
                            <Rectangle.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleY="-1" ScaleX="-1"/>
                                    <SkewTransform/>
                                    <RotateTransform Angle="178.344"/>
                                    <TranslateTransform/>
                                </TransformGroup>
                            </Rectangle.RenderTransform>
                            <Rectangle.OpacityMask>
                                <VisualBrush Visual="{StaticResource appbar_stop}" Stretch="Fill" />
                            </Rectangle.OpacityMask>
                        </Rectangle>
                    </Button>
                    <Label Content="Opkomend / Lopend" HorizontalAlignment="Left" Margin="107,80,0,0" VerticalAlignment="Top" Height="38" FontSize="20" Width="206"/>
                    <Label Content="Afgelopen" HorizontalAlignment="Left" Margin="107,316,0,0" VerticalAlignment="Top" FontSize="20"/>
                    <DataGrid x:Name="ContractAfgelopenGrid" AutoGenerateColumns="False" HorizontalAlignment="Left" Margin="107,358,0,-30" VerticalAlignment="Top" Height="210" Width="709" IsReadOnly="True">
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=CompanyName}" Header="Bedrijf"/>
                            <DataGridTextColumn Binding="{Binding Path=Description}" Header="Contract Formula"/>
                            <DataGridTextColumn Binding="{Binding Path=StartDate}" Header="Startdatum"/>
                            <DataGridTextColumn Binding="{Binding Path=EndDate}" Header="Einddatum"/>
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
            </TabItem>
            <TabItem Header="Kalender" Margin="127,35,-128,-36" RenderTransformOrigin="0.525,2.619">
                <Grid>
                    <Viewbox Margin="105,130,733,184">
                        <Calendar x:Name="CalendarZalen" Width="188" Height="180" SelectedDatesChanged="CalendarZalen_SelectedDatesChanged">
                        </Calendar>
                    </Viewbox>
                    <DataGrid x:Name="DatagridCalendarZalen" IsReadOnly="True" HorizontalAlignment="Left" Margin="542,142,0,0" VerticalAlignment="Top" Height="224" Width="523"/>
                </Grid>
            </TabItem>
            <TabItem Header="Mijn reservaties" Margin="132,36,-132,-37">
                <Grid Margin="0,0,0,0">
                    <DataGrid x:Name="ReservatieGrid" AutoGenerateColumns="False" Margin="110,69,120,0" IsReadOnly="True">
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=CompanyName}" Header="Bedrijf"/>
                            <DataGridTextColumn Binding="{Binding Path=LocationName}" Header="Locatie"/>
                            <DataGridTextColumn Binding="{Binding Path=StartDate}" Header="Startdatum"/>
                            <DataGridTextColumn Binding="{Binding Path=EndDate}" Header="Einddatum"/>
                            <DataGridTextColumn Binding="{Binding Path=CreateDate}" Header="Aanmaak datum"/>
                        </DataGrid.Columns>
                    </DataGrid>
                    <Button x:Name="addButton" Click="addButton_Click" Margin="0,69,10,0" Style="{DynamicResource MetroCircleButtonStyle}" Width="60" Height="60" VerticalAlignment="Top" HorizontalAlignment="Right">
                        <Rectangle Fill="#7f8c8d" Height="35" RenderTransformOrigin="0.5,0.5" Width="35">
                            <Rectangle.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleY="-1" ScaleX="-1"/>
                                    <SkewTransform/>
                                    <RotateTransform/>
                                    <TranslateTransform/>
                                </TransformGroup>
                            </Rectangle.RenderTransform>
                            <Rectangle.OpacityMask>
                                <VisualBrush Visual="{StaticResource appbar_add}" Stretch="Fill" />
                            </Rectangle.OpacityMask>
                        </Rectangle>
                    </Button>
                    <Button x:Name="editButton" Click="EditButton_Click" Margin="0,140,10,0" Style="{DynamicResource MetroCircleButtonStyle}" Width="60" Height="60" VerticalAlignment="Top" HorizontalAlignment="Right">
                        <Rectangle Fill="#7f8c8d" Height="26" RenderTransformOrigin="0.5,0.5" Width="27">
                            <Rectangle.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleY="-1" ScaleX="-1"/>
                                    <SkewTransform/>
                                    <RotateTransform Angle="178.344"/>
                                    <TranslateTransform/>
                                </TransformGroup>
                            </Rectangle.RenderTransform>
                            <Rectangle.OpacityMask>
                                <VisualBrush Visual="{StaticResource appbar_edit}" Stretch="Fill" />
                            </Rectangle.OpacityMask>
                        </Rectangle>
                    </Button>
                    <Button x:Name="removeButton" Click="removeButton_Click" Margin="0,211,10,0" Style="{DynamicResource MetroCircleButtonStyle}" Width="60" Height="60" VerticalAlignment="Top" HorizontalAlignment="Right">
                        <Rectangle Fill="#7f8c8d" Height="26" RenderTransformOrigin="0.5,0.5" Width="27">
                            <Rectangle.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleY="-1" ScaleX="-1"/>
                                    <SkewTransform/>
                                    <RotateTransform Angle="178.344"/>
                                    <TranslateTransform/>
                                </TransformGroup>
                            </Rectangle.RenderTransform>
                            <Rectangle.OpacityMask>
                                <VisualBrush Visual="{StaticResource appbar_delete}" Stretch="Fill" />
                            </Rectangle.OpacityMask>
                        </Rectangle>
                    </Button>
                </Grid>
            </TabItem>
        </TabControl>
    </Grid>
</controls:MetroWindow>